<a class="icon_new" title="Ajouter une promotion" href="<?php echo shRequest::link('administration', 'promotion', 'create', $specialite->id)?>">Créer une promotion</a>
<?php foreach( $promotions as $promotion): ?>
    <table class="liste">
	<thead>
	    <tr>		
		<th>Promotion <?php echo Date::fromSGBD($promotion->date_debut)->toFormulaire() ?> - <?php echo Date::fromSGBD($promotion->date_fin)->toFormulaire() ?> <?php if ( $promotion->visible == 0 ): ?>(Invisible)<?php endif; ?></th>
		<th class="icon"><a class="calendar" title="Gérer les périodes de désactivation" href="<?php echo shRequest::link('administration','joursdesactivespromotion',null,$promotion->id)?>"></a></th>
		<th class="icon"><a class="edit" title="Modifier la promotion" href="<?php echo shRequest::link('administration','promotion','edit',$promotion->id)?>"></a></th>
		<th class="icon"><a class="delete" title="Supprime la promotion" href="<?php echo shRequest::link('administration','promotion','delete',$promotion->id)?>"></a></th>
	</tr>
	</thead>
	<tbody>
	    <tr>
		<td colspan="4"><a href="<?php echo shRequest::link('administration', 'groupe', 'create', array($promotion->id)) ?>" class="icon_new">Ajouter un groupe pour un <span style="text-decoration:underline;">nouvel enseignement</span></a></td>
	    </tr>
	    <?php foreach ($promotion->enseignements AS $enseignement): ?>
		<tr>
		    <td colspan="4" style="padding:9px 3px;font-weight: bold;"><?php echo $enseignement->type_enseignement ?> <?php echo apostrophe('de', $enseignement->ue) ?></td>
		 </tr>
		<tr>
		    <td style="padding-left: 30px;" colspan="4"><a href="<?php echo shRequest::link('administration', 'groupe', 'create', array($promotion->id, $enseignement->ueId)) ?>" class="icon_new" style="font-weight:normal;">Ajouter un groupe pour cet enseignement</a></td>
		</tr>
		<?php foreach( $enseignement->groupes AS $groupe ): ?>
		<tr>
		    <td style="padding-left: 30px;" colspan="2"><?php echo $groupe->intitule ?></td>
		    <td class="icon"><a class="edit" title="Modifier le groupe" href="<?php echo shRequest::link('administration','groupe','edit',$groupe->id)?>"></a></td>
		    <td class="icon"><a class="delete" title="Supprime le groupe" href="<?php echo shRequest::link('administration','groupe','delete',$groupe->id)?>"></a></td>
		</tr>
		<?php endforeach; ?>
	    <?php endforeach; ?>
<?php endforeach; ?>
	</tbody>
    </table>
